home *** CD-ROM | disk | FTP | other *** search
/ New Masters of Flash / New Masters of Flash.iso / pc / MOVIES / 05.dir / 00218_Text_text15.txt < prev    next >
Text File  |  2000-10-01  |  2KB  |  11 lines

  1. Frame 6: 
  2. (label Mousetracking) Mousetracking
  3.  
  4. This frame contains one of the three scripts that are called from the main looping script. This script deals specifically with tracking the mouse pointer location and converting the mouse pointerΓÇÖs X and Y screen coordinates into degrees for the X and Y rotation of the 3D object.
  5.  
  6. When the invisible button receives a click and drag action, it tells "/Mouseloc" to be dragged from its original position. "/Mouseloc" is a blank movie clip that tracks the movement of the mouse, but is not directly used to set the rotation.
  7. I wanted the rotation to have a delay effect so that the 3D object would slowly rotate to its new position. I did this by using a second object named "/TrailerObj", that follows "/Mouseloc" with a delayed action. It is this delay that is seen in the animation. The delay in the movement of "/TrailerObj" is achieved by first calculating the distance between "/Mouseloc" and "TrailerObj" for their X and Y positions.
  8. By dividing Variable: "DifferenceX" by 5, a value can be derived which is added on to the X position of  "/TrailerObj" so that "/TrailerObj" starts moving towards "/Mouseloc". The effect is that "/TrailerObj" will always move towards the position of "/Mouseloc". The larger the number one use to divide Variable: "DifferenceX", the longer "/TrailerObj" will take to reach the X-position of  "/Mouseloc". The same also applies to Variable: "DifferenceY"
  9.  
  10. The rest of the script on this frame deals with converting the X and Y position of the mouse to X and Y angle values which can be used for rotation in the 3d view. I did this in two parts, first setting Variable:"Yangle", the value of which represents the rotation angle around the Y-axis and then Variable:"Xangle" for the X-axis. 
  11.